/***
author : sailing
date : 2016/12/22
*****/

<style lang='less'>
.ftable {
  margin-top: 10px;
  width:100%;
  position:relation
}
</style>

<template>
  <div class='ftable'>
    <el-table
    :data="fiberData"
    :height="mainHeight"
    border
    style="width: 100%">
    <el-table-column
      type="index"
      label='序号'
      width="100">
    </el-table-column>
    <el-table-column
      prop="name"
      label="用户"
      width="200">
    </el-table-column>
    <el-table-column
      prop="ip"
      label="ip"
      width="200">
    </el-table-column>
    <el-table-column
      prop="level"
      width='180'
      label="level">
    </el-table-column>
    <el-table-column
      prop="last_access_time"
      width= '180'
      label="登录日期">
    </el-table-column>

    <el-table-column
      prop="session_key"
      label="session_key">
    </el-table-column>
    
  </div>
</template>

<script>
import eventBus from '../../eventBus'
import addFiber from '../../server/addFiber'
export default {
  data () {
    return {
      mainHeight: 500,
      fiberData: []
    }
  },
  methods: {
    refreshBnt (index, data) {
      eventBus.bus.$emit('refreshFiber', data[index])
    },
    showAllPort (index, data) {
      eventBus.bus.$emit('showAllPort', data[index])
    }
  },
  mounted () {
    const that = this
    var h = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight
    this.mainHeight = h - 140
    eventBus.bus.$on('getSessionListConfig', function (items) {
      console.log('items xxxx  uuuuuuuuuuuuu:', items)
      that.fiberData = items
    })
  }
}
</script>
